<?php

namespace Home\Controller;

use Think\Controller;
use Home\Service\UpgradationService;

/**
 * 围棋宝典升级篇 Controller
 *
 * @author 李静波
 *        
 */
class UpgradationController extends BaseController {

	/**
	 * 首页
	 */
	public function index() {
		$this->initVar();
		
		$this->assign("title", "升级篇");
		
		$us = new UpgradationService();
		$this->assign("data", $us->allExercise(1));
		
		$this->display();
	}

	public function ex() {
		$this->initVar();
		
		$level = I("get.level");
		$index = I("get.index");
		
		$this->assign("title", "第{$level}关第{$index}题");
		
		$us = new UpgradationService();
		$this->assign("fileName", $us->getExerciseFileName($level, $index));
		
		$this->display();
	}
}